package org.middleware.controller;

import org.middleware.component.MessageConsumer;
import org.middleware.component.MessageProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RabbitmqController {

    @Autowired
    private MessageProducer messageProducer;

    @Autowired
    private MessageConsumer messageConsumer;

    @GetMapping("/send")
    public String sendMessage() {
        messageProducer.sendMessage("exchange.direct", "JYT1", "hello rabbitmq");
        return "消息已发送";
    }



}
